<?php

namespace app\models;

use Yii;
use yii\elasticsearch\ActiveRecord;

/**
 * This is the model class for table "rules".
 *
 * @property integer $id
 * @property string $name
 * @property string $url
 * @property string $url_pages_url
 * @property string $list
 * @property string $title
 * @property string $time
 * @property string $writer
 * @property string $content
 * @property string $content_page_url
 * @property string $commonts_page_url
 * @property string $created
 * @property string $updated
 * @property string $charset
 */
class Rules extends ActiveRecord
{
    public static function index()
    {
        return 'db';
    }

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'rules';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['created', 'updated'], 'safe'],
            [['name', 'url', 'url_pages_url', 'list', 'title', 'time', 'writer', 'content', 'content_page_url', 'commonts_page_url', 'charset'], 'string', 'max' => 255]
        ];
    }

    public function attributes()
    {
        // path mapping for '_id' is setup to field 'id'
        return ['id','created', 'updated','name', 'url', 'url_pages_url', 'list', 'title', 'time', 'writer', 'content', 'content_page_url', 'commonts_page_url', 'charset'];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'url' => 'Url',
            'url_pages_url' => 'Url Pages Url',
            'list' => 'List',
            'title' => 'Title',
            'time' => 'Time',
            'writer' => 'Writer',
            'content' => 'Content',
            'content_page_url' => 'Content Page Url',
            'commonts_page_url' => 'Commonts Page Url',
            'created' => 'Created',
            'updated' => 'Updated',
            'charset' => 'Charset',
        ];
    }
}
